<%--
  Created by IntelliJ IDEA.
  User: 曾小丽
  Date: 2018/3/27
  Time: 20:30
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>

<link rel="stylesheet" href="${pageContext.request.contextPath}/statics/css/style.css" type="text/css"></link>

<script type="text/javascript" src="${pageContext.request.contextPath}/statics/js/jquery-1.12.4.js"></script>
<script type="text/javascript">
    $(function(){
        $(".del").click(function(){
            alert("hahahhahaha");
        });
    });
</script>
<body>
<center>
    <h3>用户信息</h3>
    <form action="/smbms/ck" method="post">
        支持模糊查询：
        <input type="text" name="name">
        <input type="submit">
        <input type="button" class="del" value="删除">
    </form>

    <table border="1">
        <tr style="color: palegoldenrod">
            <td>id</td>
            <td>用户名称</td>
            <td>密码</td>
            <td>编码</td>
            <td align="center">操作</td>
        </tr>
        <c:forEach items="${list}" var="v" varStatus="st">
            <tr <c:if test="${st.index%2!=0}">style="color: blueviolet" </c:if>
                <td></td>
                <td>${v.id}</td>
                <td>${v.userName}</td>
                <td>${v.userPassword}</td>
                <td>${v.userCode}</td>
                <td><a href="/smbms/del?uid=${v.id}">删除</a> <a href="/smbms/xiu?uName=${v.userName}&uid=${v.id}">修改</a> </td>
            </tr>
        </c:forEach>
    </table>

    <a href="/smbms/insert">新增用户信息！</a><br>
    <c:if test="${index<=all && index!=1}">
        <a href="/smbms/ck?indexPage=1">首页</a><br>
        <a href="/smbms/ck?indexPage=${index-1}">上一页</a><br>
    </c:if>
    <c:if test="${index>=1 && index!=all}">
        <a href="/smbms/ck?indexPage=${index+1}">下一页</a><br>
        <a href="/smbms/ck?indexPage=${all}">末页</a><br>
    </c:if>
    总共有：${index}/${all}页
</center>
</div>
</body>
</html>
